import React from 'react';
import {
    HashRouter as Router,
    Routes,
    Route
} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '@/components/loading';

import CommonLayout from '@/layout/commonLayout';
import UserLayout from '@/layout/userLayout';

const Home = Loadable({ loader: () => import('@/pages/home'), loading: Loading })
const About = Loadable({ loader: () => import('@/pages/about'), loading: Loading })


const RouterConfig: React.FC = () => {
    return (
        <Router>
            <Routes>
                <Route path="/" element={<CommonLayout />}>
                    <Route path="/" element={<Home />} />
                    <Route path="/about" element={<About />} />
                </Route>
            </Routes>
        </Router>      
    )
}

export default RouterConfig